<?php
error_reporting("E_ALL^E_NOTICE");
session_start();
include './function/Tampil2.php';
?>
<html>
    <head>
        <meta name="key/words" content="berbagi,charity,community"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/bootstrap.css">       
        <link rel="stylesheet" href="style.css">   
        <title>Semua Berbagi-Indonesia Charity Community</title>
    </head>
    <body>
        <?php
        if (isset($_SESSION['user'])) {
            $status = $_SESSION['user']['status'];
        }
        $t = new Tampil2();
        ?>
        <div class="container">            
            <div class="navbar navbar-default" role="navigation">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed togle_margin" data-toggle="collapse" data-target=".navbar-collapse"> 
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span> 
                            <span class="icon-bar"></span> 
                            <span class="icon-bar"></span> 
                        </button> 
                        <form class="navbar-form" role="search">
                            <div class="input-group">
                                <input type="text" class="form-control" placeholder="Search" name="text_search">
                                <div class="input-group-btn">
                                    <button class="btn btn-default buttonCari" type="submit" name="button_search"><i class="glyphicon glyphicon-search"></i></button>
                                </div>
                            </div>
                        </form>
                    </div> 
                    <div class="navbar-collapse collapse"> 
                        <?php
                        if (!isset($_SESSION['user'])) {
                            ?>
                            <ul class="nav navbar-nav navbar-right"> 
                                <li>
                                    <a href="http://semuaberbagi.com/masuk.php">Masuk</a>
                                </li>
                                <li>
                                    <a href="http://semuaberbagi.com/daftar.php">Daftar</a>
                                </li> 
                            </ul>
                            <?php
                        } else {
                            ?>
                            <ul class="nav navbar-nav navbar-right"> 
                                <li>
                                    <a href="pageUser.php">|    Halaman Saya</a>
                                </li>
                                <li>
                                    <a href="clearsession.php">|    Logout</a>
                                </li>
                            </ul>                        
                            <div class="navbar-text navbar-right">Masuk sebagai <b><?php echo '  ' . $status . '  ' ?></b></div>
                            <?php
                        }
                        ?>
                    </div> 
                </div>
            </div>
            <div class="jumbotron utama">
                <div class="row">
                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
                        <img src="img/logo.png" class="img-responsive im"/>
                        <ul class="nav nav-pills nav-stacked menu">
                            <li>
                                <a href="#"><small>Our Mission</small></a>
                            </li>
                            <li>
                                <a href="#"><small>Donation</small></a>
                            </li>
                            <li>
                                <a href="#"><small>Help Children</small></a>
                            </li>
                            <li>
                                <a href="#"><small>Save The Earth</small></a>
                            </li>
                        </ul>
                    </div>
                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
                        <center><h3>Cari Berbagi</h3></center>
                        <form action="hasilcari.php" class="form-horizontal" method="GET">
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="Kata Kunci" name="katakunci"/>
                            </div>
                            <div class="form-group">
                                <select class="form-control" name="kategori">
                                    <option value="">Kategori</option>
                                    <?php
                                    for ($index2 = 0; $index2 < sizeof($t->tampilIDKategori()); $index2++) {
                                        ?>
                                        <option value="<?php echo $t->tampilIDKategori()[$index2] ?>"><?php echo $t->tampilKategori()[$index2] ?></option>
                                        <?php
                                    }
                                    ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <select class="form-control" name="provinsi">
                                    <option value="">Provinsi</option>
                                    <?php
                                    for ($index3 = 0; $index3 < sizeof($t->tampilIdProvinsi()); $index3++) {
                                        ?>
                                        <option value="<?php echo $t->tampilIdProvinsi()[$index3] ?>"><?php echo $t->tampilProvinsi()[$index3] ?></option>
                                        <?php
                                    }
                                    ?>
                                </select>
                            </div>
                            <input type="submit" class="btn btn-primary" value="CARI" name="cari"/>                           
                        </form>
                    </div>
                </div>
            </div>

            <div class="panel panel-default panelAtas">
                <div class="panel-body">                    
                    <div class="row">
                        <div class="col-md-7 col-xs-12">
                            <img src="inspiratif/ins1.png" class="img-responsive im"/>
                        </div>
                        <div class="col-md-5 col-xs-12">
                            <div class="panel panel-default panelIns">
                                <div class="panel-heading">
                                    <blockquote class="blockQuoteBerbagi">
                                        Testimoni
                                    </blockquote>
                                </div>
                                <div class="panel-body">
                                    <?php
                                    echo $t->get3Testimoni();
                                    ?>
                                </div>
                                <div class="panel-footer">
                                    <ul class="pagination pagination-sm fotoAtas">
                                        <li><a href="#">&laquo;</a></li>
                                        <li><a href="#">1</a></li> 
                                        <li><a href="#">2</a></li> 
                                        <li><a href="#">3</a></li> 
                                        <li><a href="#">4</a></li> 
                                        <li><a href="#">5</a></li> 
                                        <li><a href="#">&raquo;</a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="panel panel-default panelKat">
                <div class="panel-heading">
                    <blockquote class="blockQuoteBerbagi">
                        <label>Kategori Barang</label>
                    </blockquote>
                </div>
                <form action="hasilcari.php" method="GET">
                    <div class="row">
                        <div class="col-md-3 col-xs-12">
                            <center><input type="image" src="kategori/1.png" class="img-thumbnail" name="kategori" value="106"/></center>
                        </div>
                        <div class="col-md-3 col-xs-12">
                            <center><input type="image" src="kategori/2.png" class="img-thumbnail" name="kategori" value="107"/></center>
                        </div>
                        <div class="col-md-3 col-xs-12">
                            <center><input type="image" src="kategori/3.png" class="img-thumbnail" name="kategori" value="108"/></center>
                        </div>
                        <div class="col-md-3 col-xs-12">
                            <center><input type="image" src="kategori/4.png" class="img-thumbnail" name="kategori" value="110"/></center>
                        </div>
                    </div>
                </form>
            </div>
            <div class="panel panel-default panelKat">
                <div class="panel-heading">
                    <!--                    <div class="row">
                                            <div class="col-md-6 col-xs-6">
                                                <div class="row">
                                                    <div class="col-md-6 col-xs-6">
                                                        <div class="row">
                                                            <div class="col-md-6 col-xs-12">
                                                                <a href="#">
                                                                    <button type="button" class="btn btn-default"><img src="img/facebook.png" class="img-responsive"/>Like</button>
                                                                </a>
                                                            </div>
                                                            <div class="col-md-6 col-xs-12">
                                                                <span class="badge">3.8m</span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6 col-xs-6">
                                                        <div class="row">
                                                            <div class="col-md-6 col-xs-12">
                                                                <a href="#">
                                                                    <button type="button" class="btn btn-default"><img src="img/twitter.png" class="img-responsive"/>Follow</button>
                                                                </a>
                                                            </div>
                                                            <div class="col-md-6 col-xs-12">
                                                                <span class="badge">140K followers</span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-xs-6">
                                            </div>
                                        </div>-->
                </div>
                <?php
                $count = 0;
                $iftrue = 1;
                for ($index = 0; $index < 20 && $iftrue == 1; $index++) {
                    ?><div class="row"><?php
                    for ($index1 = 0; $index1 < 4 && $iftrue == 1; $index1++) {
                        if ($count < sizeof($t->TampilBarangTeratas())) {
                            ?>
                                <div class="col-md-3 col-xs-12">
                                    <center>
                                        <div class="panel-body utama">
                                            <a href="deskripsiBarang.php?barang=<?php echo $t->TampilBarangTeratas()[$count] ?>"><img src="<?php echo $t->TampilUrlGambarBarang($t->TampilBarangTeratas()[$count]) ?>" class="img-thumbnail"/></a>
                                            <a href="deskripsiBarang.php?barang=<?php echo $t->TampilBarangTeratas()[$count] ?>"><b><center><?php echo $t->TampilNamaBarang($t->TampilBarangTeratas()[$count]) ?></center></b></a>
                                            <?php
                                            if ($status != '') {
                                                ?>
                                                <!--                                                <div class="row">
                                                                                                    <div class="col-md-5 col-xs-3">
                                                                                                        <h5 class="h5Like"><a href="#">Like  <span class="badge">200</span></a></h5>
                                                                                                    </div>
                                                                                                    <div class="col-md-7 col-xs-4">
                                                                                                        <h5 class="h5Comment"><a href="#">Comment  <span class="badge">150</span></a></h5>
                                                                                                    </div>
                                                                                                </div>-->
                                                <br>
                                                <ul class="list-group">
                                                    <li class="list-group-item"></li>
                                                    <li class="list-group-item"></li>
                                                    <li class="list-group-item"></li>
                                                    <li class="list-group-item"></li>
                                                </ul>
                                            <?php }
                                            ?>
                                        </div>
                                    </center>
                                </div>
                                <?php
                            } else {
                                $iftrue = 0;
                            }
                            $count++;
                        }
                        ?></div><?php
                }
                ?>
            </div>
            <div class="panel panel-default panelKat">
                <div class="panel-footer panelKaki">
                    <div class="row">
                        <div class="col-md-12 col-xs-12">
                            <br><br><br>
                            <center><label class="fontKaki"><h4>@ Copyright 2014 semua berbagi - All right reserved</h4></label></center>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="js/jquery.min.js"></script>
        <script src="js/bootstrap.js"></script>
    </body>
</html>



